package cn.china.service1.service;

import entity.Student;
import mapper.StudentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Service
@RestController
public class StudentService implements StudentMapper {
    @Autowired
    StudentMapper sm;

    @Override
    @RequestMapping("/insert")
    public int insert(Student student) {
        return sm.insert(student);
    }

    @Override
    @RequestMapping(value = "/selectByPrimaryKey" , produces = "application/json;charset:UTF-8")
    public Student selectByPrimaryKey(Integer id) {
        return sm.selectByPrimaryKey(1);
    }

    @RequestMapping("/getString" )
    public String getString(){
        return "吃饭";
    }
}
